package cn.pugle.redis.pubsub;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPubSub;

import java.util.Scanner;

/**
 *
 * @author tzp
 * @date 2017/10/17
 */
public class Publisher extends JedisPubSub {
    public static final String HOST = "";
    public static final int PORT = 6379;


    public static void main(String[] args) {
        Jedis jedis = new Jedis(HOST, PORT);
        Publisher publisher = new Publisher();
        System.out.println("message to pub:");
        Scanner scanner = new Scanner(System.in);
        String line = scanner.nextLine();
        jedis.publish("c2", line);

        jedis.close();
    }
}
